<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    div {
        width: 300px;
        height: 300px;
        background-color: #f00;
        position: absolute;
        left: 0;
        top: 50px;
    }
</style>

<body>
    <button>移动</button>
    <div></div>
    <script>
        document.querySelector("button").onclick = function () {
            document.querySelector("div").style.left = '500px'
        }
    </script>
</body>

</html>